vr2-3-35.wrl


[ VRML source code ]

#VRML V2.0 utf8
#vr2-3-35.wrl
#Colorful Piramids
Shape {
  geometry IndexedFaceSet {
    coord DEF Pyramid Coordinate {
      point [ 
         10  10 0, 
        -10  10 0, 
        -10 -10 0, 
         10 -10 0,
          0   0 15 
      ]
    }
    coordIndex [ 
          0, 1, 4, -1,   # side 0
          1, 2, 4, -1,   # side 1
          2, 3, 4, -1,   # side 2
          3, 0, 4, -1,   # side 3
          3, 2, 1, 0, -1 # side 4
    ]
    color DEF PColor Color {
      color [
          1 0 0,      # color 0
          0 1 0,      # color 1
          0 0 1,      # color 2
          1 1 0,      # color 3
          1 0 1       # color 4
      ]
    }
    colorPerVertex FALSE
  }
}
Transform {
  translation 25 0 0
  children Shape {
    geometry IndexedFaceSet {
      coord USE Pyramid 
      coordIndex [ 
          0, 1, 4, -1,   # side 0
          1, 2, 4, -1,   # side 1
          2, 3, 4, -1,   # side 2
          3, 0, 4, -1,   # side 3
          3, 2, 1, 0, -1 # side 4
      ]
      color USE PColor
      colorIndex [ 3, 2, 1, 0]
      colorPerVertex FALSE
    }
  }
}
Transform {
  translation 0 -25 0
  children Shape {
    geometry IndexedFaceSet {
      coord USE Pyramid 
      coordIndex [ 
          0, 1, 4, -1,   # side 0
          1, 2, 4, -1,   # side 1
          2, 3, 4, -1,   # side 2
          3, 0, 4, -1,   # side 3
          3, 2, 1, 0, -1 # side 4
      ]
      color USE PColor
      colorPerVertex TRUE
    }
  }
}
Transform {
  translation 25 -25 0
  children Shape {
    geometry IndexedFaceSet {
      coord USE Pyramid 
      coordIndex [ 
          0, 1, 4, -1,   # side 0
          1, 2, 4, -1,   # side 1
          2, 3, 4, -1,   # side 2
          3, 0, 4, -1,   # side 3
          3, 2, 1, 0, -1 # side 4
      ]
      color USE PColor
      colorIndex [ 3, 2, 1, 0]
      colorPerVertex TRUE
    }
  }
}